import request from './request' //导入二次封装的axios
function get_data_path() {
  let idx = process.resourcesPath.indexOf('\\node_modules\\');
  if (idx == -1) {
    // 生成环境
    return 'product';//process.resourcesPath + '\\..\\_data\\';
  } else {
    // 开发环境
    return 'development';//process.resourcesPath.substring(0, idx) + '\\_data\\';
  }
}
const NODE_ENV = get_data_path();
// export const baseTestApi = 'https://chat.dwzq.com.cn';
// export const chatTestUrl = 'https://chat.dwzq.com.cn';
export const baseTestApi = NODE_ENV === 'development' ? 'http://10.18.8.72:44334' : 'https://chat.dwzq.com.cn';//'https://pushtest.showcai.com.cn:22883'
export const chatTestUrl = NODE_ENV === 'development' ? 'http://10.18.8.72:44334' : 'https://chat.dwzq.com.cn';
//web系统地址
export const chatWebUrl = NODE_ENV === 'development' ? 'https://chat.dwzq.com.cn/dwChat/#/chat-questions-answers' : 'https://chat.dwzq.com.cn/dwChat/#/chat-questions-answers';

// 下面封装我们的接口（这里面封装的是用户信息的相关请求)

// 获取二维码
export const userGetOR = ({ uuid }) => request.get(`${baseTestApi}/dwgpt/qrLogin/getQRCode?key=${uuid}&source=1`)

// 获取用户的登录状态
export const userGetStatusService = ({ uuid }) => request.get(`${baseTestApi}/dwgpt/qrLogin/getStatus?key=${uuid}`)

// 扫码成功后获取用户的登录信息
export const userGetInfoService = ({ uuid }) => request.get(`${baseTestApi}/dwgpt/oauth/login?key=${uuid}`)

// 登出
export const userLogoutService = () => request.get(`${baseTestApi}/dwgpt/qrLogin/logout`)

// 获取AI桌面提示词快捷菜单
export const getShortcutPromptList = () => request.get(`${baseTestApi}/dwgpt/chatassistant/getShortcutPromptList`)

// 获取AI桌面助手指定登录用户的会话记录
export const findConversationInfo = (body: any) => request.post(`${baseTestApi}/dwgpt/chatassistant/findConversationInfo`, body)

// 会话
export const chatOperate = (body: any) => request.post(`${baseTestApi}/dwgpt/chatpage/chat`, body)

// 会话标题生成
export const genTitle = (body: any) => request.post(`${baseTestApi}/dwgpt/chatpage/gen_title`, body)

// 清空会话
export const clearConversation = (body: any) => request.post(`${baseTestApi}/dwgpt/chatassistant/clearConversation`, body)

//GET获取助手系统设置值
export const getSystemMap = () => request.get(`${baseTestApi}/dwgpt/chatassistant/getSystemMap`)

//更新助手系统设置值
export const setSystemMap = (body: any) => request.post(`${baseTestApi}/dwgpt/chatassistant/updateSystemMap`,body)

//获取助手兼容APP的功能选项菜单
export const getFunctionOptionList = () => request.get(`${baseTestApi}/dwgpt/chatassistant/getFunctionOptionList`)


// const js = {
//   iconNum: 5,//图标数量
//   onTop: true,// 是否至于顶层
//   hotKey:"Ctrl+Alt+Space",//弹窗快捷键设置
//   pauseTime: 0// 60 * 30 * 1000//暂停快捷图标时间
// }

